<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>jsencrypt的使用</title>
        <script type="text/javascript" src="crypto-js.js" ></script>
        <script>
var key  = CryptoJS.enc.Utf8.parse('abcdefgabcdefg12');//Latin1 w8m31+Yy/Nw6thPsMpO5fg==
function Encrypt(word){  
  var srcs = CryptoJS.enc.Utf8.parse(word);  
  var encrypted = CryptoJS.AES.encrypt(srcs, key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7});  
   return encrypted.toString();  
} 
var content = Encrypt("123")
console.log(content)
        </script>
    </head>
    </body>


</html>
